Referring to FIG. 1, the present invention concerns interactions and interdependencies of agents 102-1 through 102-N cooperating in a distributed processing computer system 100. Depending on the operating system used, each agent may be a thread or process, and thus is a unit that executes a computation or program. Some of the agents 102-1 through 102-N may be executing on a single common data processing unit while others are executing at remote sites on other data processing units. More generally, agents can be hosted on different computer systems using different operating systems. For the purposes of the present discussion, it is sufficient to assume that there is a communications path or bus 110 which interconnects all the agents in the system 100.
In a typical system 100, some of the agents will be resource managers, such as a database management server (DBMS), while other agents will be computational units working directly on behalf of the users of the system. For those not familiar with transaction (database) processing, a DBMS is a program which handles all access to a particular database, thereby relieving users of the system from having to deal with such complicated technical problems as efficiently storing data and sharing data with a community of users.
In a transaction processing system such as an airline reservation system, agents will be created dynamically as requests are made at reservation terminals. Each agent is created by portions of the system to handle various aspects of the work associated with any particular query or set of queries or updates being sent by a particular reservation terminal.
The present invention concerns a general methodology for interlinking these agents 102 so as to maintain data consistency and to define and enforce interdependencies between the calculations being performed by various ones of the agents. For instance, one agent 102-1 might generate a query that results in the formation of two child agents 102-2 and 102-3, each of which will handle database operations in different portions of the distributed database. At the time that the two child agents 102-2 and 102-3 are created, the present invention defines exactly how these agents are interdependent, and sets up the necessary data structures to denote those interdependencies, as will be explained in more detail below.
Each agent 102 represents a particular computation as a finite state machine which progresses through a sequence of internal states. Complex computations are mapped by their agents into simpler sets of states suitable for synchronization with other computations. A typical sequence of state transitions for an agent is shown in FIG. 2. Definitions of the states 121-127 for the agent shown in FIG. 2 are listed in Table 1.
TABLE 1 ______________________________________ REF STATE NAME DESCRIPTION ______________________________________ 120 Active Performing a computation 121 Finishing Computation is complete and waiting for one or more finish pre-conditions to be satisfied 122 Finished Computation is complete and all finish pre-conditions have been satisfied 123 Preparing Check on whether agent is able to commit the transaction 124 Prepared Agent is prepared to commit or abort 125 Committing Agent is unconditionally committed. Results of computation become visible. 126 Aborting Rollback objects affected by computation so as to leave everything as it was before computation began 127 Forgotten Computation completed or aborted and purged from system ______________________________________
In a typical transaction processing system, the process running in an Agent can be aborted due to an internal error condition at any time until the processes is prepared. Typical internal error conditions which might cause a process to abort include a "divide by zero", an attempt to execute an illegal instruction due to a programming error, an unauthorized attempt to access privileged system resources, or the unavailability of a resource needed to complete the computation. Once the agent has prepared, this means that the agent guarantees that it can save the results of its computation in a permanent fashion if the distributed transaction commits, and that it can rollback the results of the transaction so as to leave everything as it was before the transaction began should the distributed transaction fail to commit.
The present invention provides a very general and flexible system and method for making state transitions in each agent dependent on the status of other agents cooperating in the distributed process.